package com.simple.datax.transform.tcs;

/**
 * @Title: AbstractTcs2EcTransformer.java
 * @Package com.simple.datax.transform.tcs
 * @Description: TODO(添加描述)
 * @author Paladin Chen
 * @date 2013-1-22 下午10:43:04
 * @version V1.0
 */
public abstract class AbstractTcs2EcTransformer {
	protected void messageHeadTransform(com.simple.datax.xml.tcs.MessageHeadDocument.MessageHead tcsMessageHead,
			com.simple.datax.xml.ec.MessageHeadDocument.MessageHead ecMessageHead) {
		ecMessageHead.setMessageId(tcsMessageHead.getMessageId());
		ecMessageHead.setMessageType(tcsMessageHead.getMessageType());
		ecMessageHead.setMessageTime(tcsMessageHead.getMessageTime());
		ecMessageHead.setSenderId(tcsMessageHead.getSenderId());
		ecMessageHead.setSenderAddress(tcsMessageHead.getSenderAddress());
		ecMessageHead.setReceiverId(tcsMessageHead.getReceiverId());
		ecMessageHead.setReceiverAddress(tcsMessageHead.getReceiverAddress());
		if (tcsMessageHead.getDataCompress() == null) {
			ecMessageHead.setDataCompress("");
		} else {
			ecMessageHead.setDataCompress(tcsMessageHead.getDataCompress());
		}

		if (tcsMessageHead.getDataEncoding() == null) {
			ecMessageHead.setDataEncoding("");
		} else {
			ecMessageHead.setDataEncoding(tcsMessageHead.getDataEncoding());
		}
		ecMessageHead.setDataResponse(tcsMessageHead.getDataResponse());
		ecMessageHead.setDataUnwrap(tcsMessageHead.getDataUnwrap());
	}
}
